package com.wocao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wocao.entity.SysUserRole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
* @Entity com.wocao.entity.SysUserRole
*/
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {

    //清空用户角色关系
    @Delete("DELETE FROM sys_user_role WHERE user_id = #{userId}")
    void nullRoleByUser(Long userId);

    //添加用户角色关系
    void addRoleByUser(@Param("userId") Long userId, @Param("roleIds") List<Integer> roleIds);

}
